package com.soul.doc.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Data
@Component
@ConfigurationProperties(prefix = "minio")
public class MinioConfig {

    // endPoint是一个URL，域名，IPv4或者IPv6地址
    private String endpoint;

    private String accesskey;

    private String secretkey;


    @Bean
    public MinioClient getMinioClient() throws Exception {
        return MinioClient.builder().endpoint(endpoint).credentials(accesskey,secretkey).build();
    }
}
